package com.galaxy.bean;

// default package
// Generated 28 Jul, 2014 8:04:07 PM by Hibernate Tools 3.4.0.CR1

import static javax.persistence.GenerationType.IDENTITY;

import java.util.HashSet;
import java.util.Set;

import javax.persistence.Column;
import javax.persistence.Entity;
import javax.persistence.FetchType;
import javax.persistence.GeneratedValue;
import javax.persistence.Id;
import javax.persistence.OneToMany;
import javax.persistence.Table;

/**
 * AdminRole generated by hbm2java
 */
@Entity
@Table(name = "admin_role", catalog = "magento")
public class AdminRole implements java.io.Serializable 
{
	private static final long serialVersionUID = 121323L;

	private Integer roleId;
	private int parentId;
	private short treeLevel;
	private short sortOrder;
	private String roleType;
	private int userId;
	private String roleName;
	private Set adminRules = new HashSet(0);

	public AdminRole() {
	}

	public AdminRole(int parentId, short treeLevel, short sortOrder,
			String roleType, int userId, String roleName) {
		this.parentId = parentId;
		this.treeLevel = treeLevel;
		this.sortOrder = sortOrder;
		this.roleType = roleType;
		this.userId = userId;
		this.roleName = roleName;
	}

	public AdminRole(int parentId, short treeLevel, short sortOrder,
			String roleType, int userId, String roleName, Set adminRules) {
		this.parentId = parentId;
		this.treeLevel = treeLevel;
		this.sortOrder = sortOrder;
		this.roleType = roleType;
		this.userId = userId;
		this.roleName = roleName;
		this.adminRules = adminRules;
	}

	@Id
	@GeneratedValue(strategy = IDENTITY)
	@Column(name = "role_id", unique = true, nullable = false)
	public Integer getRoleId() {
		return this.roleId;
	}

	public void setRoleId(Integer roleId) {
		this.roleId = roleId;
	}

	@Column(name = "parent_id", nullable = false)
	public int getParentId() {
		return this.parentId;
	}

	public void setParentId(int parentId) {
		this.parentId = parentId;
	}

	@Column(name = "tree_level", nullable = false)
	public short getTreeLevel() {
		return this.treeLevel;
	}

	public void setTreeLevel(short treeLevel) {
		this.treeLevel = treeLevel;
	}

	@Column(name = "sort_order", nullable = false)
	public short getSortOrder() {
		return this.sortOrder;
	}

	public void setSortOrder(short sortOrder) {
		this.sortOrder = sortOrder;
	}

	@Column(name = "role_type", nullable = false, length = 1)
	public String getRoleType() {
		return this.roleType;
	}

	public void setRoleType(String roleType) {
		this.roleType = roleType;
	}

	@Column(name = "user_id", nullable = false)
	public int getUserId() {
		return this.userId;
	}

	public void setUserId(int userId) {
		this.userId = userId;
	}

	@Column(name = "role_name", nullable = false, length = 50)
	public String getRoleName() {
		return this.roleName;
	}

	public void setRoleName(String roleName) {
		this.roleName = roleName;
	}

	@OneToMany(fetch = FetchType.LAZY, mappedBy = "adminRole")
	public Set getAdminRules() {
		return this.adminRules;
	}

	public void setAdminRules(Set adminRules) {
		this.adminRules = adminRules;
	}

}
